package com.javarush.test.level26.lesson10.home02;

import java.util.concurrent.ConcurrentHashMap;

/**
 * Created by admin on 08.04.2015.
 */
public class Producer implements Runnable {

    protected ConcurrentHashMap<String, String> map;

    public Producer(ConcurrentHashMap<String, String> map) {
        this.map = map;
    }

    @Override
    public void run() {
        int i=0;
        try {
            while (true) {
                System.out.println("Some text for " + ++i);
                Thread.currentThread().sleep(500);
            }
        }catch (Exception e){
            System.out.println(Thread.currentThread().getName()+ " thread was terminated");
        }
    }
}
